class: center, middle, inverse, title-slide .title[ # GitHub (and Data Science Tools)
🐱
for Psychologists ] .subtitle[ ## Wake Forest University ] .author[ ### S. Mason Garrison ] --- layout: true <div class="my-footer"> <span> <a href="https://DataScience4Psych.github.io/DataScience4Psych/" target="_blank">Data Science for Psychologists</a> </span> </div> --- <!-- In my upcoming talk, 'GitHub (and Data Science Tools) for Psychologists,' I will showcase the expansive capabilities of GitHub. Initially conceived for software developers, this version control platform holds untapped potential for the psychology community. We’ll start by showcasing applications of GitHub, from managing research labs and teaching courses to publishing academic papers. Following this, I will provide an overview of the platform, shedding light on how it facilitates project management, code sharing, and tool development through its tracking and collaboration features. Tailored specifically for psychologists, this session will demonstrate practical ways in which GitHub can enhance research productivity and collaboration. Join us to explore how GitHub transcends its software development origins to become an indispensable tool in the field of psychology. --> class: middle # Hello world! --- # Introduction to GitHub - **Origins:** Launched in 2008, GitHub began as a platform for software developers to collaborate on code. - **Evolution:** Over the years, GitHub has grown into a vast community where millions share, develop, and maintain software. - **Beyond Code:** GitHub's use has expanded beyond software development to include academics, writers, and researchers who collaborate on various projects. - **Features:** Offers version control with Git, issue tracking, project boards, and a platform for project management and collaboration - **In Education:** GitHub Classroom and _free_ educational accounts bolster its use in teaching and learning. - GitHub's unique blend of features supports not just coding projects but also the collaborative and iterative nature of academic research and teaching. --- # What is Git? What is GitHub? - **Git:** A version control system that tracks changes in files and facilitates collaborative work on projects. Git runs locally on your computer, allowing you to manage your project's history. - **GitHub:** A web-based platform built on top of Git. It hosts your repositories online, making it easier to share your projects with others. GitHub adds a layer of social networking, issue tracking, project boards, and more to your Git projects. - **Synergy:** While Git manages your project history locally, GitHub takes it to the cloud, enabling collaboration across teams globally. Together, they streamline project workflows and enhance productivity. Using Git and GitHub together combines the power of version control with the ease of online collaboration. --- # Why GitHub for Psychologists? - **Collaboration Made Easy:** Facilitates seamless collaboration across the globe, essential for multi-center studies and remote teams. - **Project Management:** Whether it's research data, experimental protocols, or manuscripts, manage all aspects of your projects in one place. - **Transparency and Reproducibility:** Open-source projects and data sharing align with the principles of open science, enhancing credibility and reproducibility. - **Educational Tool:** GitHub Classroom enables interactive learning, allowing students to submit assignments and get feedback easily. - **Streamlined Publishing:** Use platforms like JOSS (The Journal of Open Source Software) to publish tools developed for psychological research, fostering innovation. For psychologists, GitHub offers a platform to not only enhance research productivity but also contribute to a more open and collaborative scientific community. --- # Exploring GitHub's Potential for the Psychology Community --- # GitHub for Project Management - **Centralized Workspace:** Manage your research projects in a single space, accessible to the whole team. - **Issue Tracking:** Log tasks, bugs, and feature requests as issues to keep track of project progress. - **Milestones:** Set important project milestones to track progress towards major goals. - **Project Boards:** Use Kanban-style boards to visualize workflow, from idea to implementation. .footnote[Learn more about GitHub for project management: [GitHub Project Management](https://docs.github.com/en/issues/trying-out-the-new-projects-experience)] ## Managing Research Projects and Labs - **Collaboration at Scale:** GitHub enables team members to work together seamlessly, regardless of their location. - **Transparency and Reproducibility:** By hosting your lab's projects on GitHub, you ensure that your research processes are transparent and your results are reproducible. - **Example:** My [R Computing Lab](https://github.com/R-Computing-Lab) demonstrates how labs can manage datasets, code, and collaborate on analysis in real(ish)-time. .pull-left[ <img src="data:image/png;base64,#img/screenshot_r_lab_loggedout.png" width="90%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="data:image/png;base64,#img/screenshot_r_lab.png" width="90%" style="display: block; margin: auto;" /> ] --- ## Teaching Courses .pull-left[ - **Interactive Learning:** GitHub provides a platform for sharing up-to-date course materials and notes, making learning more interactive and engaging. - **Version Control for Syllabi:** Easily update and revise syllabi policies, dates etc. (https://smasongarrison.github.io/syllabi/) - **Examples:** The [Data Science for Psychologists course repository](https://github.com/DataScience4Psych) repository showcases how GitHub can be used to enhance the teaching and learning experience. ] -- .pull-right[ <img src="data:image/png;base64,#img/syllabus.png" width="85%" style="display: block; margin: auto;" /> ] --- ### Data Science for Psychologists .pull-left[ <img src="data:image/png;base64,#img/screenshot_coursebook.png" width="85%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="data:image/png;base64,#img/screenshot_courserepo.png" width="85%" style="display: block; margin: auto;" /> ] --- ## Publishing Academic Papers - **Streamlined Publication Process:** GitHub supports the publishing process with version control and collaboration, making the development and review of manuscripts more efficient. - **Open Collaboration:** Encourages open and collaborative peer review and feedback from the global community. - **Example:** The Journal of Open Source Software (JOSS) uses GitHub to manage submissions, reviews, and publication processes. https://joss.theoj.org/papers/10.21105/joss.06203 -- .pull-left[ <img src="data:image/png;base64,#img/screenshot_joss.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="data:image/png;base64,#img/screenshot_joss_review.png" width="100%" style="display: block; margin: auto;" /> ] --- ## Website Hosting with GitHub <!-- Beyond code and collaboration, GitHub serves as an efficient host for personal academic websites, CVs, and even presentations like this one. --> - **Showcase Your Work:** GitHub Pages allows researchers and academics to host their professional portfolios, CVs, and even project pages for free. - **Example:** Visit [S. Mason Garrison's CV](https://smasongarrison.github.io/CV-Tex/SMasonGarrisonCV.pdf) hosted on GitHub for an example of how you can use GitHub Pages to host your academic CV. .pull-left[ <img src="data:image/png;base64,#img/screenshot_cv_host.png" width="100%" style="display: block; margin: auto;" /> ] .pull-right[ <img src="data:image/png;base64,#img/screenshot_cv_commits.png" width="100%" style="display: block; margin: auto;" /> ] --- # Intriguing, right? --- # GitHub toolkit overview --- <img src="data:image/png;base64,#img/whole-game-01.png" width="100%" style="display: block; margin: auto;" /> --- <img src="data:image/png;base64,#img/whole-game-02.png" width="100%" style="display: block; margin: auto;" /> --- <img src="data:image/png;base64,#img/whole-game-03.png" width="100%" style="display: block; margin: auto;" /> --- <img src="data:image/png;base64,#img/whole-game-04.png" width="100%" style="display: block; margin: auto;" /> --- # Terminology ## Repositories - Store your projects in repositories, including all files, revisions, and documentation. ## Branches - Work on different versions of a repository at the same time, allowing for parallel development. ## Commits - Save changes to your project, creating a transparent history of your work and decisions. ## Pull Requests - Propose changes to a project and discuss those changes with project collaborators before merging them. ## Issues - Track ideas, enhancements, tasks, or bugs for your projects. Organize with labels, assignees, and milestones. ## GitHub Actions - Automate your workflow from idea to production with CI/CD pipelines directly in GitHub. ## Project Boards - Plan and track your work and workflows with customizable project boards. ## GitHub Pages - Host and publish your projects, documentation, or portfolio directly from your GitHub repository. --- class: middle # Git and GitHub --- ## Version control - We introduced GitHub as a platform for collaboration - But it's much more than that... - It's actually designed for version control --- ## Versioning <img src="data:image/png;base64,#img/lego-steps.png" width="70%" style="display: block; margin: auto;" /> --- ## Versioning with human readable messages <img src="data:image/png;base64,#img/lego-steps-commit-messages.png" width="70%" style="display: block; margin: auto;" /> --- ## Why do we need version control? <img src="data:image/png;base64,#img/phd_comics_vc.gif" width="40%" style="display: block; margin: auto;" /> --- # Git and GitHub tips - Git is a version control system -- like “Track Changes” features from Microsoft Word on steroids. GitHub is the home for your Git-based projects on the internet -- like DropBox but much, much better). -- - There are millions of git commands -- ok, that's an exaggeration, but there are a lot of them -- and very few people know them all. 99% of the time you will use git to add, commit, push, and pull. -- - We will be doing Git things and interfacing with GitHub through RStudio, but if you google for help you might come across methods for doing these things in the command line -- skip that and move on to the next resource unless you feel comfortable trying it out. -- - There is a great resource for working with git and R: [happygitwithr.com](http://happygitwithr.com/). Some of the content in there is beyond the scope of this talk, but it's a good place to look for help. --- ## Let's take a tour - Git and GitHub .center[  ] - Connect an R project to Github repository - Working with a local and remote repository - Making a change locally, committing, and pushing - Making a change on GitHub and pulling --- ## Create a GitHub account .small[ .instructions[ Go to [github.com](https://github.com/), and create an account (unless you already have one). ] ] Tips for selecting a username:<sup>✦</sup> .small[ - Incorporate your actual name. - Reuse username from other contexts, e.g., Twitter or Slack. - Pick a username you'll be comfortable revealing to your future boss. - Shorter is better than longer. - Be as unique as possible in as few characters as possible. - Make it timeless. Don't highlight your current university, employer, etc. - Avoid words laden with special meaning in programming, like `NA`. ] -- .small[ <sup>✦</sup> Source: [Happy git with R](http://happygitwithr.com/github-acct.html#username-advice) by Jenny Bryan ] --- class: middle ## Practical Demonstrations --- # Practical Demonstrations: Connecting R to GitHub ## Step 1: Create a New Repository on GitHub - Go to [GitHub](https://github.com/) and click on "New" in the Repositories tab. - Name your repository and add a brief description. - Choose to initialize with a README for an easy start. ## Step 2: Clone the Repository in RStudio - In RStudio, go to File > New Project > Version Control > Git. - Paste the URL of your GitHub repository. - Choose a directory to store the project on your computer. ## Step 3: Make Changes and Commit - Modify an existing file or create a new file in the RStudio project. - Go to the Git tab in RStudio, check the files you've changed, and click "Commit". - Write a commit message describing the changes and commit. ## Step 4: Push Changes to GitHub - After committing your changes, click the "Push" button in RStudio to update your GitHub repository. - Your changes are now on GitHub! ## Step 5: Pull Changes from GitHub - If changes are made on GitHub (by you or collaborators), you can update your local repository by clicking "Pull" in RStudio. .footnote[For a detailed guide, check out [Happy Git and GitHub for the useR](http://happygitwithr.com/)] --- # Getting Started with GitHub 1. **Sign Up on GitHub** - Visit [GitHub.com](https://github.com/) and create a new account. 2. **Create Your First Repository** - Click the "+" icon in the top right corner and select "New repository". - Name your repository and optionally add a description. 3. **Install Git** - Download and install Git from [git-scm.com](https://git-scm.com/). 4. **Configure Git with RStudio** - In RStudio, go to Tools > Global Options > Git/SVN and make sure Git is recognized. 5. **Clone a Repository** - Use the "New Project" wizard in RStudio to clone your repository for local work. 6. **Resources to Learn More** - [GitHub Guides](https://guides.github.com/) - [Happy Git and GitHub for the useR](http://happygitwithr.com/) Start experimenting with small projects to get comfortable with the workflow. Happy coding! --- class: middle # Conclusion and Q&A --- class: middle # Wrapping Up...